using System.Xml.Serialization;

namespace Opo.Perspective.Core
{
    /// <summary>
    /// Represents a tag
    /// </summary>
    [XmlRoot("tag")]
    public class Tag : ITag
    {
        /// <summary>
        /// Gets or sets the name of the tag.
        /// </summary>
        /// <value>The name of the tag.</value>
        [XmlText()]
        public string TagName { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="Tag"/> class.
        /// </summary>
        /// <param name="tagName">Name of the tag.</param>
        public Tag(string tagName)
        {
            TagName = tagName;
        }

        /// <summary>
        /// Returns the TagName of the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A string containing the TagName.
        /// </returns>
        public override string ToString()
        {
            return TagName;
        }
    }
}
